package com.nimble.smile.utils;

import android.app.ProgressDialog;
import android.content.Context;
import android.util.Log;

public class UIHelper {
	
	private static UIHelper instance = null;
    private ProgressDialog progressDialog;

	private UIHelper() {
		
	}
	
	public static UIHelper getInstance() {
		if (instance == null)
			instance = new UIHelper();
		return instance;
	}

    public void showProgressDialog(Context ctx, String str){
        progressDialog = new ProgressDialog(ctx);
        progressDialog.setTitle("");
        progressDialog.setCanceledOnTouchOutside(false);
        progressDialog.setMessage(str);
        progressDialog.show();
    }

    public void hideProgressDialog() {
        try {
            if (progressDialog != null) {
                progressDialog.dismiss();
                progressDialog = null;
            }
        } catch (Exception e) {
            Log.e("UIHelper", "hideProgressDialog failed", e);
        }
    }

}